/**
 * Created by Administrator on 2017/5/17.
 */
import { Component } from '@angular/core';
import { Student } from './Student.entity';

@Component({
    moduleId: module.id,//moduleId属性来指定模板和样式文件相对于组件类文件的位置
    selector: 'site-form',
    templateUrl: 'site-form.component.html'
})

export class SiteFormComponent {
    submitted = false;
    onSubmit(){
        this.submitted = true;
    }

    sex = ['男','女'];
    model = new Student(1,'张三',this.sex[0],18);

    // todo: 测试数据
    get diagnostic(){ return JSON.stringify(this.model); }

    newSite(){
        this.model = new Student(++this.model.id,'',this.sex[0]);
    }
}